#ifndef RENDER_TO_TEXTURE_SAMPLE_H
#define RENDER_TO_TEXTURE_SAMPLE_H

#include "SampleBase.h"
#include "glslprogram.h"
#include "cube.h"
#include "objmesh.h"
#include <glm/glm.hpp>
using glm::vec3;
using glm::vec4;
using glm::mat4;
namespace ShaderLab {
	
	class RTSample : public SampleBase {
	public:
		RTSample();
		~RTSample();

		void Init();
		void Update(float time);
		void Render();
		void Imgui();
		void ShutDown();
	private:
		GLSLProgram program;
		GLuint fboHandle;
		std::unique_ptr<Cube> cube;
		std::unique_ptr<ObjMesh> spot;
		mat4 model,view,projection;
		GLuint renderTex;
		GLuint depthBuf;
	private:
		void CreateShader();
		void SetupFBO();
		void RenderToTexture();
		void DrawScene();
	};
}
#endif // !TEMPLATE_SAMPLE_H
